home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_c / sm099c.zip / EXAMPLE / UTILS.C < prev    next >
C/C++ Source or Header  |  1996-03-03  |  916b  |  49 lines

  1. #include "example.h"
  2.  
  3. void GetScrSize ( int *piScrW, int *piScrH )
  4. /* Fetch out current width and height of screen */
  5. {
  6.    #ifdef GUI
  7.    #ifdef OS2
  8.    RECTL Rect;
  9.    WinQueryWindowRect (hWndClient, &Rect);
  10.    *piScrW = Rect.xRight;
  11.    *piScrH = Rect.yTop;
  12.    #else
  13.    *piScrW = getmaxx ();
  14.    *piScrH = getmaxy ();
  15.    #endif
  16.    #else
  17.    struct text_info ti;
  18.    gettextinfo (&ti);
  19.    *piScrW = ti.screenwidth;
  20.    *piScrH = ti.screenheight;
  21.    #endif
  22. }
  23.  
  24. void ClrScr ( void )
  25. /* Clear the screen */
  26. {
  27.    #ifdef GUI
  28.    #ifdef OS2
  29.    RECTL Rect;
  30.    WinQueryWindowRect (hWndClient, &Rect);
  31.    WinFillRect (hPS, &Rect, CLR_BLACK);
  32.    #else
  33.    cleardevice ();
  34.    #endif
  35.    #else
  36.    clrscr ();
  37.    #endif
  38. }
  39.  
  40. void Pause ( int iMilliSeconds )
  41. /* Sleep specified number of milliseconds */
  42. {
  43.    #ifdef OS2
  44.    DosSleep (iMilliSeconds);
  45.    #else
  46.    delay (iMilliSeconds);
  47.    #endif
  48. }
  49.